{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4bc2d7ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "# only run this if your have an editable install\n",
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "159588d4",
   "metadata": {},
   "source": [
    "the dataset has 2 modes\n",
    "- fullwiki - here the model is required to generate answer give the first paragraphs of all the wikipedia articles \n",
    "- distractor - here the context as a mix of 8 missleading paragraphs and 2 golden paragraphs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "85836493",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Found cached dataset hotpot_qa (/home/jjmachan/.cache/huggingface/datasets/hotpot_qa/fullwiki/1.0.0/133b9501f892e5193babbad937bee3b4899deb4691ef4d791e6ac0111c875bb5)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Dataset({\n",
       "    features: ['id', 'question', 'answer', 'type', 'level', 'supporting_facts', 'context'],\n",
       "    num_rows: 7405\n",
       "})"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from datasets import load_dataset, concatenate_datasets\n",
    "\n",
    "DATASET_URL = \"hotpot_qa\"\n",
    "SPLIT = \"validation\"\n",
    "ds = load_dataset(DATASET_URL, \"fullwiki\", split=SPLIT)\n",
    "ds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "ae72aff3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'title': ['Henry Roth', 'Robert Erskine Childers'], 'sent_id': [0, 0]}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds[19][\"supporting_facts\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2988f801",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
